/*
 * Copyright (C), 2002-2016, 苏宁易购电子商务有限公司
 * FileName: MerchantBatchOrderDemo.java
 * Author:   16031333
 * Date:     2016年5月25日 上午9:42:36
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.hl.toolkit.server.suning.demo;

import com.suning.SuNingConfig;
import com.suning.dto.BatchWithdrawData;
import com.suning.util.Util;

/**
 * 〈一句话功能简述〉<br>
 * 〈批量出款到卡〉
 * 
 * @author 16031333
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
public class BatchWithdrawDemo {

    public String action(String receiverName,
      	  String amount,String bankName,  String receiverCardNo,   String bankCode,String batchNo ) throws Throwable {
        BatchWithdrawData batchWithdrawData = new BatchWithdrawData();
         String result="";
  		
        try {
            String responseData = batchWithdrawData.batchWithDraw(SuNingConfig.withdrawUrl,  receiverName,
                	    amount,  bankName,    receiverCardNo,     bankCode,batchNo);
            result=responseData;
         System.out.println("批量出款responseData:" + responseData);

        } catch (Exception e) {
            System.out.println("调用批量出款出错：" + e);
        }
       return result;
    }

    public static void main(String[] args) throws Throwable {
   /**   PublicKey pubKey = RSAUtil.resolvePublicKey("src/main/resources/RSA/public.key");
        PrivateKey priKey = RSAUtil.resolvePrivateKey("src/main/resources/RSA/private.key");
 		System.out.println("公钥："+RSAUtil.getBase64PublicKeyString(pubKey));
		System.out.println("私钥："+RSAUtil.getBase64PrivateKeyString(priKey));
		**/
  	  BatchWithdrawDemo demo = new BatchWithdrawDemo();
    	String batchNo = Util.generalBatchNo();
		System.out.println(batchNo);
       demo.action("徐炼","100","平安银行","6230583000003598755","PAB",batchNo); 
    	
    	// String wagKeyString ="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCbFR1mQQxAnXtzEZIp/Lo4RVzU2c/FGCc7QoRHqBQTAxRXtn+n94ldgQBauDNm+nMu5UtsS0r+hXfaeTdJrhJ7pMZUy90kjLdvmzJ5EbjoQGoJdCzmthWBNvRD+m2tAAxYbDb0mcCpvor93RIkbkcphZudCvkG8+/xAfNmJdyZQIDAQAB";
    	// PublicKey pubKey = RSAUtil.getPublicKey(wagKeyString);
 		//System.out.println("公钥："+RSAUtil.getBase64PublicKeyString(pubKey));
     //	boolean bool=RSAUtil.vertiy("32EF72941CD88ECFD6E8D9A67E89C601", "I6t6lm59CAL4_jILdgripVZDdtmynuUMCcFKN_HsrATLVwFIyCB-OyVSKEB68D4JHVhE7iwvhNMpzyVbwdhi4qZaV_2LTh-G1672LBH2AccnPcIdQvTxNYWf1mKfVsXrIPo-PTbE8gazgP_3srhCiaGwjbARPzR79GE7Pew_s7A", pubKey);
   // System.out.println("--------------boolean:"+bool+"-----------------");
    }
}
